import pandas as pd
import matplotlib.pyplot as plt


df1 = pd.read_excel("/Users/andy/Downloads/011/Users.xlsx")
df1["Total"] = df1["Oct"]+df1["Nov"]+df1["Dec"]
df1.sort_values(by="Total", ascending=False, inplace=True)
df1.plot.bar(x="Name", y=["Oct","Nov","Dec"], title="Users Data",stacked=True)
#关键参数是stacked, 这样就可以做出叠加柱状图
df1.plot.barh(x="Name", y=["Oct","Nov","Dec"], title="Users Data",stacked=True)
#bar后面加h表示水平展示叠加柱状图

plt.show()








